<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
    (function(arr){
        var len = arr.length,
        newArr = [],
        flag;
        for(var i = 0; i < len; i++, flag = 1){
            for(var j = 1; j < i; j++){
                console.log(i,j,arr[i],arr[j]);
                if(arr[i] == arr[j]){
                    flag = 0;
                }
                }
                flag?newArr.push(arr[i]):'';
            }
            alert(newArr);
        })([1,1,22,3,22, 3, 4, 55, 66]);
   
</script>